﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Commctrol_AgentList : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //根据条件查询数据
            this.Repeater1.DataSource = BandDG();
            this.Repeater1.DataBind();
        }
    }

    private DataTable BandDG()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("Imag");
        dt.Columns.Add("Name");
        dt.Columns.Add("Call");
        dt.Columns.Add("Area");
        dt.Columns.Add("company");
        dt.Columns.Add("HomeInfo");
        dt.Columns.Add("Url");

        for (int i = 0; i < 20; i++)
        {
            DataRow dr = dt.NewRow();

            dr[0] = "http://images.anjukestatic.com/attachments/10/05/07/8/c/0/1005078c05ac983050e3416d73839f67fc8420_1.jpg";
            dr[1] = "许愿望";
            dr[2] = "13916953779";
            dr[3] = "园区 坠子山";
            dr[4] = "百居益";
            dr[5] = "http://suzhou.anjuke.com/shop.php?bid=123558";
            dr[6] = "http://suzhou.anjuke.com/shop.php?bid=181423";

            dt.Rows.Add(dr);
        }

        return dt;
    }


    protected string RequestURL(string p_strID)
    {
        if (Request[p_strID] != null && Request[p_strID].ToString().Trim() != string.Empty)
        {
            return Request[p_strID].ToString().Trim();
        }
        else
        {
            return string.Empty;
        }
    }
    #region 属性
    protected string strType
    {
        get
        {
            return this.RequestURL("TYPE").ToString();
        }
    }

    protected string strArea
    {
        get
        {
            return this.RequestURL("AreaID").ToString();
        }
    }

    protected string strMinArea
    {
        get
        {
            return this.RequestURL("MinAreaID").ToString();
        }
    }

    #endregion
}
